import random

answer_num = random.randint(1, 100)  # 用户要猜的数字
times = 0  # 记录用户猜的次数

user_guess = int(input('输入你猜的数字：'))
while user_guess != answer_num:
    times += 1

    if user_guess > answer_num:
        print('猜大了')
    else:
        print('猜小了')

    user_guess = int(input('输入你猜的数字：'))

print(f'✌恭喜猜对了【{answer_num}】，你一共猜了{times + 1}次')
